| 简短说明 | |
|---|---|
|
文件: \examples\Processing\Trigger\mE4VD4-CL\Line\TrgPortLineRebuild_mE4VD4CL.va |
![]() |
|
默认平台: mE4VD4-CL |
|
|
简要说明 VisualApplets 算子 TrgPortLine 使用 VisualApplets 算子库中的其他信号处理算子进行了重建。 通过该重建,您可以自定义触发功能,并了解 VisualApplets 中许多信号处理算子的使用方法。 |
|
算子 TrgPortLine 是一个复杂的 VisualApplets 算子,提供了广泛的线扫描触发功能。 在某些应用中,需要修改此算子的功能以用于自定义信号处理。
在本示例中,我们展示了如何使用其他 VisualApplets 信号处理算子来重建 TrgPortLine 算子。 这使您能够调整和修改功能以满足您的自定义需求。 该实现较为高级但易于理解。 为了简化该实现的复杂参数设置,以下转换表可帮助您根据 TrgPortLine 参数的参数名称来计算新设计的参数。
| 名称 | YOffset |
|---|---|
| 默认 | 0 |
Device1_Process0_ImageTrigger_ImageHeight_Width = YHeight - YOffset Device1_Process0_ImageTrigger_ImageTriggerDelay_Delay_Delay = YHeight + YOffset |
|
| 名称 | YHeight |
|---|---|
| 默认 | 1024 |
Device1_Process0_ImageTrigger_ImageHeight_Width = YHeight - YOffset Device1_Process0_ImageTrigger_ImageTriggerDelay_Delay_Delay = YHeight + YOffset |
|
| 名称 | LineTriggerMode |
|---|---|
| 默认 | GrabberControlled |
Device1_Process1_LineTrigger_LineTriggerMode_Select = 3 if GrabberController 0,1 or 2 if Extern_Trigger For Extern_Trigger, the correct value is defined by the shaft encoder settings. The other modes available by TrgPortLine are not supported. |
|
| 名称 | ExsyncEnable |
|---|---|
| 默认 | OFF |
Device1_Process1_LineTrigger_Exsync_ExsyncEnable_Select = 1 if ON 0 if OFF |
|
| 名称 | LineTrgInSourceA |
|---|---|
| 默认 | 0 |
Device1_Process1_LineTrigger_TraceA_Input_Select = LineTrgInSourceA |
|
| 名称 | LineTrgInSourceB |
|---|---|
| 默认 | 1 |
Device1_Process1_LineTrigger_TraceB_Input_Select = LineTrgInSourceB |
|
| 名称 | EncoderABMode |
|---|---|
| 默认 | Signal_A_Only |
Device1_Process1_LineTrigger_LineTriggerMode_Select = 3 if LineTriggermode == GrabberControlled 0 if EncoderABMode == Signal_A_Only 1 else Device1_Process1_LineTrigger_ShaftEncoder_Mode = Mode1X if EncoderABMode == Signal_AB_Filter Mode2X if EncoderABMode == Signal_ABx2_Filter Mode4X if EncoderABMode == Signal_ABx4_Filter |
|
| 名称 | EncoderABLead |
|---|---|
| 默认 | Signal_AB |
Device1_Process1_LineTrigger_ShaftEncoder_LeadingTrace = A if EncoderABLead == Signal_AB B else |
|
| 名称 | LineTrgInPolarity |
|---|---|
| 默认 | LowActive |
Device1_Process1_LineTrigger_TraceA_Polarity_Invert = Invert if LineTrgInPolarity = LowActive NotInvert else |
|
| 名称 | LineTrgInPolarity |
|---|---|
| 默认 | LowActive |
Device1_Process1_LineTrigger_TraceA_Polarity_Invert = Invert if LineTrgInPolarity = LowActive NotInvert else Device1_Process1_LineTrigger_TraceB_Polarity_Invert = Invert if LineTrgInPolarity = LowActive NotInvert else |
|
| 名称 | LineTrgDownscaler |
|---|---|
| 默认 | 1 |
Device1_Process1_LineTrigger_Downscale_Donwscale = LineTrgDownscaler |
|
| 名称 | LineTrgPhase |
|---|---|
| 默认 | 1 |
Device1_Process1_LineTrigger_Downscale_SelectecPulse = LineTrgPhase |
|
| 名称 | ExsyncPeriod |
|---|---|
| 默认 | 100µs |
Device1_Process1_LineTrigger_Generate_Period = ExsyncPeriod / TClk |
|
| 名称 | Exsync2Delay | |||
|---|---|---|---|---|
| 默认 | 0µs | |||
Device1_Process1_LineTrigger_Exsync_Exsync2_Delay = Exsync2Delay / TClk
|
||||
| 名称 | ExsyncPolarity |
|---|---|
| 默认 | LowActive |
Device1_Process1_LineTrigger_Exsync_OutputPolarity_Polarity = Invert if ExsyncPolarity = LiwActive NotInvert else |
|
| 名称 | ImgTriggerMode |
|---|---|
| 默认 | FreeRun |
Device1_Process0_ImageTrigger_SelectGatedImageTrigger_Select = 1 if ImgTriggerMode == FreeRun 0 else Device1_Process0_ImageTrigger_SelectFreeRun_Select = 1 if ImgTriggerMode == FreeRun 0 else |
|
| 名称 | ImgTriggerInSource |
|---|---|
| 默认 | InSignal0 |
Device1_Process0_ImageTrigger_EnableSoftwareTrigger = 1 if ImgTriggerInSource == SoftwareTrigger 0 else Device1_Process0_ImageTrigger_ImageTriggerInput_Input_Select = 0 if ImgTriggerInSource == InSignal0 1 if ImgTriggerInSource == InSignal1 2 if ImgTriggerInSource == InSignal2 3 if ImgTriggerInSource == InSignal3 4 if ImgTriggerInSource == InSignal4 5 if ImgTriggerInSource == InSignal5 6 if ImgTriggerInSource == InSignal6 7 if ImgTriggerInSource == InSignal7 |
|
| 名称 | ImgTrgInPolarity |
|---|---|
| 默认 | LowActive |
Device1_Process0_ImageTrigger_ImageTriggerInput_Polarity_Polarity = Invert if ImgTrgInPolarity == LowActive NotInvert else |
|
| 名称 | ImgTrgDelay | |||
|---|---|---|---|---|
| 默认 | 0 行 | |||
Device1_Process0_ImageTrigger_ImageTriggerDelay_Delay_Delay = ImgTrgDelay
|
||||
| 名称 | FlashEnable |
|---|---|
| 默认 | OFF |
Device1_Process0_ImageTrigger_FlashOutput_Enable_Select = 1 if FlashEnable == ON 0 else |
|
| 名称 | FlashPolarity |
|---|---|
| 默认 | LowActive |
Device1_Process0_ImageTrigger_FlashOutput_Polarity_Polarity = Invert if FlashPolarity == LowActive NotInvert else |
|
| 名称 | FlashDelay | |||
|---|---|---|---|---|
| 默认 | 0 行 | |||
Device1_Process0_ImageTrigger_FlashDelay_Delay_Delay = FlashDelay
|
||||
| 名称 | SoftwareTrgPulse |
|---|---|
Device1_Process0_ImageTrigger_SoftwareTrigger_Mode = Pulse if SoftwareTrgPulse == 1 && ImgTrgMode == ExternSw_Trigger not write access else |
|
| 名称 | SoftwareTrgInput |
|---|---|
Device1_Process0_ImageTrigger_SoftwareTrigger_Mode = High if SoftwareTrgInput == 1 && ImgTrgMode == ExternSw_Gate Low else |
|
| 名称 | ImgTrgIsBusy(只读参数) |
|---|---|
ImgTrgIsBusy = Device1_Process0_ImageTrigger_ImgTrgIsBusy_Status |
|
| 名称 | CC1output |
|---|---|
| 默认 | Exsync |
Device1_Process1_LineTrigger_Exsync_CC1_Select_Select = 0 if Exsync 1 if ExsyncInvert 2 if Exsync2 3 if Exsync2Invert 4 if Flash 5 if FlashInvert 6 if Gnd 7 if Vcc |
|
| 名称 | CC2output |
|---|---|
| 默认 | Exsync |
Device1_Process1_LineTrigger_Exsync_CC2_Select_Select = 0 if Exsync 1 if ExsyncInvert 2 if Exsync2 3 if Exsync2Invert 4 if Flash 5 if FlashInvert 6 if Gnd 7 if Vcc |
|
| 名称 | CC3output |
|---|---|
| 默认 | Exsync |
Device1_Process1_LineTrigger_Exsync_CC3_Select_Select = 0 if Exsync 1 if ExsyncInvert 2 if Exsync2 3 if Exsync2Invert 4 if Flash 5 if FlashInvert 6 if Gnd 7 if Vcc |
|
| 名称 | CC4output |
|---|---|
| 默认 | Exsync |
Device1_Process1_LineTrigger_Exsync_CC4_Select_Select = 0 if Exsync 1 if ExsyncInvert 2 if Exsync2 3 if Exsync2Invert 4 if Flash 5 if FlashInvert 6 if Gnd 7 if Vcc |
|
| 名称 | ImgTrgDebounceMaxTime |
|---|---|
| 在此实现中不需要。 | |
| 名称 | ImgTrgDebouncingTime |
|---|---|
| 默认 | 65.520 µs |
Device1_Process0_ImageTrigger_ImageTriggerInput_Debounce_Debounce = ImgTrgDebouncingTime / TClk |
|
| 名称 | LineTrgDebouncingTime |
|---|---|
| 默认 | 0.112 µs |
Device1_Process1_LineTrigger_TraceA_Debounce_Debounce = LineTrgDebouncingTime / TClk Device1_Process1_LineTrigger_TraceB_Debounce_Debounce = LineTrgDebouncingTime / TClk |
|
变量 TClk 取决于所使用的图像采集卡。对于 microEnable IV VD4-CL,周期为 16ns。 完整列表请查看 Appendix. Device Resources。
该实现分为 ImageTrigger 和 LineTrigger 两部分。 LineTrigger 实现位于 Process1 中。 由于该进程没有 DMA 通道,因此在将小程序加载到图像采集卡后,即使尚未开始采集,它也会立即启动。 这样做的优点是,在采集开始之前就已经可以触发相机。 有关无 DMA 通道进程的更多信息,请参见 'Processes without DMAs / Trigger Processes'。
接下来的两节将概述图像触发和行触发的实现。
图像触发部分负责组装图像,即从 1D 输入行流形成 2D 图像。 根据算子 TrgPortLine,图像高度可以由以下方式定义: 固定高度并使用所有输入行(自由运行)、固定高度但由外部控制器启动图像(外部或软件触发), 或者高度由外部或软件触发信号的脉冲长度定义(门控模式)。
图像触发实现的主要部分是 SignalGate 算子。 图像高度由门开启的时间长短来定义。 模块 ImageHeight(算子 SignalWidth)在自由运行或边沿控制触发模式下定义高度。 在这些情况下,算子值会随着每个新的输入行而增加。 这是一个很好的例子,说明了 Tick 输入用于控制计数速度。 在自由运行模式下,新图像在前一个图像完成后立即开始,即 SignalWidth 算子在其周期输出结束时完成。 在外部或软件触发模式下,新图像从 SignalWidth 输入端的上升沿开始。 需要 RS-FF 来确保脉冲足够长。
通过 SelectGatedImageTrigger,实现可以切换到门控模式,在该模式下,脉冲长度控制图像高度。
分层框 NOP_DelayChain 包含一些 NOP 算子。 这些算子用于将输入信号延迟几个时钟周期。 这是必需的,因为计算门是应开启还是关闭需要几个时钟周期。 在这种情况下,VisualApplets 无法执行自动流水线调整。 因此需要延迟。
实现的其余部分包括输入输出信号生成。 这些部分的实现简单直接。 闪光灯输出信号通过 h-box FlashOutput 中的 TxSignalLine 算子传输到 Process1。 这是必需的,因为闪光灯信号也必须输出到 CC 信号。


![[注意]](../common/images/admon/note.png)


上一页

